(function() {
  'use strict';
  angular.module('controllers.dataManager.dataQualityApplication')
    .controller('systemIndexApplicationCtrl', systemIndexApplicationCtrl);

  function systemIndexApplicationCtrl($scope, systemIndexApplicationService) {
    // $scope.dataAppl = systemIndexApplicationService;
    $scope.seq = {
      order: '',
      orderType: 'id'
    };
    $scope.dataAppl = init;

    function init() {
      systemIndexApplicationService.query(function(res) {
        if (res.data.state === '10000') {
          angular.forEach(res.data.data, function(r, index) {
            r.id = index + 1;
          });
          $scope.dataList = res.data.data;
        } else {
          console.log('获取数据失败');
        }
      });
    }

    $scope.changeOrder = function(type) {
      $scope.seq.orderType = type;
      if ($scope.seq.order === '') {
        $scope.seq.order = '-';
      } else {
        $scope.seq.order = '';
      }
    };

    // //切换TAB
    // $scope.switchTabs = function (tab) {
    //   $scope.currentTab = tab;
    // };

    // $scope.currentShow = 0;//要显示的页面下标

    // //左移
    // $scope.arrowLeft = function (idx) {
    //   if ($scope.currentShow > 0) {
    //     $scope.currentShow--;
    //   } else {
    //     $scope.currentShow = idx;
    //   }
    // };

    // //右移
    // $scope.arrowRight = function (idx) {
    //   if ($scope.currentShow < idx) {
    //     $scope.currentShow++;
    //   } else {
    //     $scope.currentShow = 0;
    //   }
    // };

    // //跳转
    // $scope.setCurrentShow = function (index) {
    //   $scope.currentShow = index;
    // };

    // systemIndexApplicationService.search();

  } // systemIndexApplicationCtrl.$inject = ['$scope', 'systemIndexApplicationService'];
})();
